﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Toto
{
    class Campo
    {
        Texture2D fundo;
        Song musica;
        Eixo eixo1, eixo2, eixo3, eixo4;

        Jogador Jogador2;

 

        public Campo(Texture2D fundo)
        {
            this.fundo = fundo;
        }


        public Campo(ContentManager Content, string imagem, GameWindow gameWindow)
        {
            this.fundo = Content.Load<Texture2D>(imagem);
        }

        public Campo(Texture2D fundo, Song musica)
        {
            this.fundo = fundo;
            this.musica = musica;
        }

        public void Update(GameTime gameTime)
        {
            eixo1.Update(new List<Keys>() { Keys.Up, Keys.Down});
            //eixo2.Update(new List<Keys>() { Keys.Up, Keys.Down});
            //eixo3.Update(new List<Keys>() { Keys.Up, Keys.Down});
            //eixo4.Update(new List<Keys>() { Keys.Up, Keys.Down}); 
        }

        public void GerarEixos(int[] formacao,Texture2D barra, Texture2D boneco, GameWindow gameWindow)
        {
            eixo1 = new Eixo(barra, new Vector2(100, 0), gameWindow, this, 1, boneco);
            eixo2 = new Eixo(barra, new Vector2(200, 0), gameWindow, this, formacao[0], boneco);
            eixo3 = new Eixo(barra, new Vector2(300, 0), gameWindow, this, formacao[1], boneco);
            eixo4 = new Eixo(barra, new Vector2(400, 0), gameWindow, this, formacao[2], boneco);
        }



        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {

            spriteBatch.Draw(fundo, Vector2.Zero, Color.White);

            eixo1.Draw(spriteBatch, gameTime);
            eixo2.Draw(spriteBatch, gameTime);
            eixo3.Draw(spriteBatch, gameTime);
            eixo4.Draw(spriteBatch, gameTime);

        }


    }
}